{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>分类列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->
            <div class="row">
                <!-- <div class="col-sm-12">
                    <form name="admin_list_sea" class="form-search" method="post" action="{:url('index')}">
                        <div class="col-sm-3" style="width:100%;">
                            <div class="input-group">
                                <select class="form-control m-b chosen-select" name="cate_id" id='cate_id' style="width:25%;">
                                    <option value="0">选择商品分类</option>
                                </select>
                                <select class="form-control m-b chosen-select" name="status" id='status' style="width:25%;">
                                    <option value="0">选择商品状态</option>
                                    <option value="1">审核中</option>
                                    <option value="2">通过</option>
                                    <option value="3">拒绝</option>
                                    <option value="4">下架</option>
                                </select>
                                <input type="text" id="title" class="form-control" name="title" value="" placeholder="输入需查询的商品标题" style="width:25%;"/>
                                <span class="input-group-btn">
                                    <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
                                </span>
                            </div>
                        </div>
                    </form>
                </div> -->
                <!--搜索框结束-->
                <div class="hr-line-dashed"></div>
                <div class="example-wrap">
                    <div class="example">
                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr class="long-tr">
                                    <th>ID</th>
                                    <th>订单号</th>
                                    <th>商品标题</th>
                                    <th>商品id</th>
                                    <th>创建时间</th>
                                    <th>结算状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="list-content">
                            {volist name="data.orders" id="vo"}
                                <tr class="long-td">
                                    <td>{$vo.id}</td>
                                    <td>{$vo.trade_id}</td>
                                    <td>{$vo.goods.title}</td>
                                    <td>{$vo.num_iid}</td>
                                    <td>{$vo.create_time|date="Y-m-d H:i",###}</td>
                                    <td>
                                    {switch name="vo.status"}
                                        {case value="0"}
                                            <a class="red" href="javascript:;">
                                                <div id=""><span class="label label-info">未结算</span></div>
                                            </a>
                                        {/case}
                                        {case value="1"}
                                            <a class="red" href="javascript:;">
                                                <div id=""><span class="label label-danger">待审核</span></div>
                                            </a>
                                        {/case}
                                        {case value="2"}
                                            <a class="red" href="javascript:;">
                                                <div id=""><span class="label label-info">已结算</span></div>
                                            </a>
                                        {/case}
                                    {/switch}
                                    </td>
                                    <td>
                                        <!-- <a href="javascript:;" class="btn btn-primary btn-xs"><i class="fa fa-paste"></i> 通过</a>&nbsp;&nbsp;
                                        <a href="javascript:;" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> 拒绝</a> -->
                                    </td>
                                </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {$data.page}
                    </div>
                </div>
                <!-- End Example Pagination -->
            </div>
        </div>
    </div>
<!-- End Panel Other -->
</div>

{include file="public/footer" /}

<script type="text/javascript">
    function examine(id,status){
        if(status == 2){
            var str = '您确定通过该请求吗？';
        }else{
            var str = '您确定拒绝该请求吗？';
        }
        var index = layer.confirm(str, {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post('{:url("examine")}',{'id':id,'status':status},function(data){
              console.log(data);
                layer.close(index);
                if(data.code == 1){
                    layer.msg(data.msg, {
                        icon: 1,time:1000
                    },function(){
                        window.location.reload()
                    });
                }else{
                    layer.msg(data.msg, {
                        icon: 2,time:1000
                    });
                }

            },'json');
        }, function(){
            layer.close(index);
        });
    }

    //拒绝
    function refuse(id){
        layer.prompt({title: '输入不通过的原因，并确认', formType: 2,area: ['300px', '200px']}, function(text, index){
            $.post('{:url("refuse")}',{'id':id,'content':text},function(data){
                if(data.code == 1){
                    layer.msg(data.msg, {
                        icon: 1,time:1000
                    },function(){
                        window.location.reload()
                    });
                }else{
                    layer.msg(data.msg, {
                        icon: 2,time:1000
                    });
                }
            },'json');
        });
    }

</script>
</body>
</html>
